/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package botlab.gui.actionlistener;

import botlab.Game;
import botlab.GameManager;
import botlab.gui.GUI;
import com.jme3.bullet.BulletAppState;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Quentin
 */
public class TestActionListener implements ActionListener
{
    private GUI gui;
    
    public TestActionListener(GUI gui)
    {
        this.gui = gui;
    }

    public void actionPerformed(ActionEvent e)
    {
        final Game game = GameManager.getInstance().getGame();
        game.enqueue(new Callable<Void>()
        {
            public Void call()
            {
                    try
                    {
                        game.getStateManager().getState(BulletAppState.class).setEnabled(
                                false);
                    } 
                    catch (Exception ex)
                    {
                        Logger.getLogger(GUI.class.getName()).log(Level.SEVERE,
                                null, ex);
                    }
                    return null;
            }
        });
    }
    
}
